<!--
 * @Date: 2020-01-16 19:30:04
 * @LastEditors: wangsh
 * @Author: wangsh
 -->
<template>
  <ms-dialog :title="title" width="30%" :dialog-visible="dialogVisible" @show="showDialog" @ok="handleSaveForm" @close="handleCloseDialog">
    <el-form v-loading="loading" ref="formValid" :model="form" :rules="rules" label-width="80px">
      <el-form-item label="角色名称" prop="name">
        <el-input v-model="form.name" />
      </el-form-item>
      <el-form-item label="角色备注" prop="remark">
        <el-input v-model="form.remark" />
      </el-form-item>
      <el-form-item label="角色标识" prop="perimission">
        <el-input v-model="form.perimission" />
      </el-form-item>
    </el-form>
  </ms-dialog>
</template>

<script>
import MsDialog from '@/common/dialog'
import tip from '@/mixins/tip'
const prefixUrl = '/sys/role/'
export default {
  components: {
    MsDialog
  },
  mixins: [tip],
  data() {
    return {
      apiUrl: {
        get: `${prefixUrl}getById`,
        save: `${prefixUrl}saveRole`
      },
      rules: {
        name: [
          { required: true, message: '请输入角色名称', trigger: 'blur' }
        ]
      }
    }
  }
}
</script>
